package com.zmj.dubbo.registry;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/**
 *
 * @author zhangmj
 * @date 2018/9/24 10:41
 */
@Component
public class ZkConfig {

    @Autowired
    private Environment environment;

    /**
     * zk集群的地址,客户端连接的地址
     * @return
     */
    public String getZkHost(){
        return environment.getProperty("zooKeeper.host");
    }

    /**
     * 所有服务发布在哪个节点下面
     * @return
     */
    public String getZkRootPath(){
        return environment.getProperty("zooKeeper.registry.path");
    }
}
